package kr.hkit.powerjava.chapter14.wb.pg;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.BorderLayout;

public class LabelandTextPanel extends JPanel {
	private JLabel lblNewLabel;
	private JTextField textField;

	/**
	 * Create the panel.
	 */
	public LabelandTextPanel(String text) {

		initialize(text);
	}
	
	private void initialize(String text) {
		setLayout(new BorderLayout(0, 0));
		
		lblNewLabel = new JLabel(text);
		add(lblNewLabel, BorderLayout.WEST);
		
		textField = new JTextField();
		add(textField, BorderLayout.EAST);
		textField.setColumns(3);
	}

	public String getTextField() {
		return textField.getText();
	}

	public void setTextField(String text) {
		textField.setText(text);
	}	

}
